package spring.boot.demo.providerservice.service;


import org.springframework.stereotype.Service;
import spring.boot.demo.providerservice.model.TestModel;

@Service("testService")
public class TestService {
    public TestModel getDataTest(){

        TestModel model = new TestModel();
        model.setId(1L);
        model.setName("test");
        return model;
    }

    public TestModel getDataTestByCondition(TestModel model){
        if(model ==null){
            return null;
        }
        if(model.getId() == null){
            return null;
        }
        model.setName(model.getName()+"_fromdb");
        return model;
    }
}
